package com.neuralnoise.hibernate.facebook;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public abstract class AbstractUserTypeRelationship implements java.io.Serializable {

	private static final long serialVersionUID = -3300465405849383816L;

	private UserTypeRelationshipId id;
	
	public AbstractUserTypeRelationship() { }
	
	public AbstractUserTypeRelationship(UserTypeRelationshipId id) {
		this();
		this.setId(id);
	}

	@EmbeddedId
	@AttributeOverrides({
		@AttributeOverride(name = "relation", column = @Column(name = "relation", nullable = false, length = 16)),
		@AttributeOverride(name = "user", column = @Column(name = "user", nullable = false, length = 32)),
		@AttributeOverride(name = "facebookType", column = @Column(name = "facebookType", nullable = false, length = 32))
	})
	public UserTypeRelationshipId getId() {
		return id;
	}

	public void setId(UserTypeRelationshipId id) {
		this.id = id;
	}
}
